import { post, text } from '@/common/request';
import { requestParams, urlApiClientContent, urlPublicContent } from './ServerService';

const url = urlApiClientContent + 'app/';

// 教材资源 目录 pageNo=0&pageSize=20&name=名字
export function textbookList({ name, pageNo, pageSize }) {
    return post(url + requestParams('textbookList', { name, pageNo, pageSize }), null);
}
// 教材资源 详情 
export function textbookInfo({ textBookId }) {
    return post(url + requestParams('textbookInfo', { textBookId }), null);
}

// 收藏
/**
 * 
"   resourceId":9,
    "type":1//1 教材资源，2资料文档
 */
export function resCollect(json) {
    return text(url + requestParams('resCollect', {}), json);
}
// 取消收藏
export function resCancel(json) {
    return text(url + requestParams('resCancel', {}), json);
}
// 收藏列表 type =》 1 教材资源，2资料文档
export function resCollectList(name,type) {
    return post(url + requestParams('resCollectList', {name,type}), null);
}

